import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';

export default async function a007(fd: IFeidaoAiBrowserComponent) {
	// 全选
	const input = event.currentTarget as HTMLInputElement;
	const flag = input.getAttribute("data-flag");
	const checkboxs = fd.data.node.querySelectorAll("[data-id='checkbox']");
	for (let i = 0; i < checkboxs.length; i++) {
		const checkbox = checkboxs.item(i) as HTMLInputElement;
		if (flag === "false") {
			checkbox.checked = true;
			checkbox.setAttribute("checked", "checked");
		} else if (flag === "true") {
			checkbox.checked = false;
			checkbox.removeAttribute("checked");
		}

	}
	if (flag === "false") {
		input.setAttribute("data-flag", "true");
	} else if (flag === "true") {
		input.setAttribute("data-flag", "false");
	}
}
